package cn.com.nes.site.rocketmq.producer;

import cn.com.nes.site.rocketmq.config.RocketMQProducerConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MessageService {

    @Autowired
    private RocketMQProducerConfig rocketMQProducer;

    // 发送消息到指定 Topic▽
    public void sendMessageToTopic(String topic, String message) {
        rocketMQProducer.sendMessage(topic, message);
    }

    // 关闭生产者
    public void shutdown() {
        rocketMQProducer.shutdown();
    }
}
